Mango Monthly Temperature Report

Christopher Milesky and Nathan Bergman

Data Entry

datarain= {{1,27.4},{2,30.1},{3,32.4},{4,32.5},{5,30.4},{6,28.2},{7,27.1},{8,26.8},{9,27.3},{10,28.8},{11,28.7},{12,27.5}};

datarain2= {{1,2.0},{2,2.9},{3,21.7},{4,66.9},{5,106.3},{6,152.1},{7,189.3},{8,233.0},{9,201.4},{10,67.4},{11,4.0},{12,1.6}};

maxtemp=Flatten[{35.6,36.4,38.6,36.7,35.7,32.0,29.3,29.1,30.6,35.1,36.9,35.6,
35.5,37.7,39.2,36.9,35.0,30.6,29.9,29.2,30.5,32.8,34.9,35.7,
37.0,38.2,37.8,36.5,33.9,32.9,30.5,29.4,31.3,32.8,35.9,36.5,
35.7,38.5,38.3,36.6,35.2,32.7,30.7,28.8,30.2,34.0,35.8,35.3,
35.4,38.0,39.0,37.4,34.2,31.2,30.7,29.8,30.5,34.2,36.9,35.2,
36.7,37.7,39.2,37.5,35.4,31.7,31.3,30.0,30.6,33.7,36.7,36.3,
35.1,38.2,37.6,36.2,35.2,31.5,30.3,29.1,30.6,34.2,36.5,35.3,
35.1,37.6,38.0,34.9,35.0,31.4,30.7,30.6,30.6,34.0,35.7,36.3,
36.2,39.3,39.7,36.4,35.6,33.1,30.6,29.9,30.8,33.1,35.4,36.8,
37.2,38.0,39.3,38.9,34.3,33.5,30.3,29.1,30.0,34.7,36.3,35.0,
35.1,37.2,38.3,37.3,34.0,32.1,29.8,29.4,30.7,34.1,36.9,35.0,
35.9,38.3,38.9,36.4,34.6,33.0,31.0,30.1,31.3,33.8,36.2,35.2,
35.9,38.8,38.8,38.6,36.4,32.8,31.4,30.6,31.0,34.8,36.4,35.9,
33.8,37.1,39.2,37.8,34.9,33.2,30.5,30.2,30.5,34.0,36.0,34.7,
34.5,37.4,38.7,36.6,34.5,33.0,29.9,30.6,30.3,33.9,36.3,35.9,
35.2,37.0,38.7,37.5,33.9,30.9,30.5,30.3,32.1,32.5,35.5,35.8,
36.6,37.7,38.2,38.9,35.3,33.0,31.4,30.3,31.6,34.0,36.8,34.2,
36.3,38.9,38.0,35.2,33.5,32.7,30.0,30.7,31.5,34.3,35.6,36.3,
37.0,38.1,38.7,38.5,34.7,31.8,30.9,31.1,31.4,34.2,35.8,34.6,
36.7,38.0,39.5,39.2,35.5,32.0,31.7,30.3,32.0,33.6,36.0,33.7,
34.6,38.2,38.4,36.2,33.9,33.3,30.9,30.4,32.3,35.9,36.4,36.6,
35.0,36.5,37.6,37.1,34.5,32.3,31.1,30.7,32.1,33.8,35.6,35.0,
31.9,38.4,39.3,38.8,36.2,31.9,30.8,31.0,31.7,35.8,37.0,36.0,
35.0,37.1,37.5,35.8,34.0,33.3,32.5,32.3,31.8,34.1,36.5,34.0,
35.9,36.3,38.8,37.3,35.7,33.0,30.5,30.3,31.1,35.1,37.0,33.5,
34.9,38.7,39.1,38.1,36.9,33.6,30.5,30.9,31.2,34.4,34.9,33.6,
36.2,38.8,38.8,40.3,38.3,33.1,31.8,31.5,32.4,34.7,37.6,35.5,
34.6,38.0,39.9,37.6,36.7,31.9,30.5,29.8,31.2,35.6,37.1,33.9,
33.8,36.0,38.0,39.6,37.4,32.3,31.2,30.4,31.8,33.9,37.3,35.0,
35.0,36.7,39.3,38.4,35.6,33.3,30.9,31.3,32.4,35.4,37.4,36.5,
36.7,38.8,38.8,37.2,33.6,33.1,30.7,31.0,32.8,34.4,36.4,35.0,
33.7,37.9,39.5,37.5,34.2,32.4,30.9,30.6,31.9,35.2,35.1,35.7,
35.3,38.0,38.8,39.6,36.9,33.9,30.8,31.4,32.0,35.1,37.4,35.7,
34.9,37.6,40.0,39.0,35.9,32.7,30.8,30.9,31.9,33.9,36.1,34.7,
34.3,37.2,39.7,38.6,36.5,34.1,32.0,30.7,33.0,34.7,36.7,36.5,
37.7,39.2,40.2,37.5,35.0,32.6,32.0,30.8,31.8,34.1,36.4,37.0,
37.0,36.5,38.3,36.7,34.0,30.2,31.5,32.0,33.8,35.6,37.2,36.6,
36.2,39.4,40.0,40.4,36.5,33.0,32.2,31.1,32.1,35.5,37.9,36.1,
36.7,37.1,40.6,38.1,36.8,34.5,31.3,30.5,31.3,34.3,37.6,35.9,
36.9,35.8,39.6,39.7,36.5,33.3,31.5,31.4,32.6,35.5,37.8,36.1,
36.5,37.4,40.5,39.4,36.5,34.1,31.9,30.4,31.5,34.4,36.4,35.5,
35.6,37.7,38.9,38.1,35.3,32.6,30.9,31.5,33.2,34.6,37.7,36.5,
36.7,40.0,39.7,37.3,37.8,32.7,32.0,31.8,32.6,36.3,38.1,36.4,
36.4,39.4,39.1,37.2,35.1,32.8,31.7,31.9,32.7,36.5,37.5,37.9,
34.4,38.9,40.5,39.2,36.4,33.6,31.9,31.6,32.9,35.7,38.4,37.6,
37.9,39.2,40.7,40.3,35.9,34.7,32.9,31.7,31.9,35.2,37.3,36.3,
35.0,39.2,40.7,38.3,35.6,33.8,32.0,30.6,32.4,36.4,37.9,36.2,
33.4,37.6,39.5,39.0,35.8,33.3,31.6,31.2,32.3,35.5,38.3,37.0,
35.4,39.7,40.6,37.5,35.8,34.5,31.6,31.6,32.4,34.7,36.8,37.7,
37.6,40.1,40.8,35.2,35.9,33.6,31.3,31.1,31.5,33.9,36.8,36.7,
35.7,38.3,40.3,39.2,36.9,34.1,32.4,31.4,32.5,34.7,37.8,35.8,
35.3,38.1,39.9,37.6,33.9,32.6,31.2,30.5,31.8,34.6,37.4,37.8,
36.0,38.7,40.0,36.8,34.6,32.9,32.0,30.8,32.3,35.0,37.7,35.6,
36.4,38.1,39.2,37.5,36.0,34.6,32.7,30.7,31.4,35.0,37.3,35.9,
34.5,38.1,38.6,38.6,37.9,35.3,32.1,30.8,32.0,34.4,36.9,33.8
}];

mintemp=Flatten[{16.9,17.5,21.7,23.8,22.9,21.1,20.6,19.9,19.5,19.8,16.8,14.8,
15.0,17.9,23.0,23.8,22.0,20.4,20.3,20.1,20.5,20.4,20.7,15.7,
16.3,21.7,22.4,23.1,22.0,20.7,19.9,19.8,19.9,19.9,15.8,15.4,
17.6,19.0,24.0,24.5,23.8,21.8,21.9,21.7,21.5,21.9,20.3,19.7,
19.5,22.1,23.7,24.8,23.3,21.9,22.0,21.5,21.2,21.5,17.7,16.7,
17.2,19.1,24.4,25.1,24.3,22.5,22.2,22.2,21.8,21.4,19.7,17.6,
17.0,21.7,23.6,24.5,23.8,22.1,22.1,21.7,21.6,21.5,19.5,20.1,
17.2,21.4,24.7,23.9,23.6,22.3,22.1,22.1,21.6,21.8,20.1,19.4,
17.3,22.7,26.1,25.1,23.3,22.2,21.4,21.5,21.3,21.3,17.9,16.1,
17.7,20.2,24.3,26.0,22.9,22.3,21.1,21.2,20.5,21.0,18.1,16.5,
15.5,21.1,24.5,24.0,22.5,21.3,20.1,20.5,20.4,20.6,18.5,19.6,
18.1,21.3,25.1,25.0,24.4,22.9,22.1,21.9,22.0,22.1,18.8,19.2,
19.0,22.5,24.7,25.8,24.8,23.1,22.4,22.3,21.4,22.4,18.9,17.9,
18.2,20.1,25.1,25.8,24.4,23.1,22.2,22.3,21.4,21.9,18.7,16.7,
16.1,20.1,24.0,24.7,23.9,22.4,21.9,22.1,21.6,21.6,19.3,18.2,
18.0,22.3,23.7,24.0,23.4,21.8,22.0,21.4,21.9,21.6,20.1,17.0,
18.6,20.3,23.2,26.4,24.9,23.4,22.7,22.3,22.4,21.3,18.2,17.8,
18.4,21.8,25.0,24.9,23.9,22.9,21.9,21.8,21.6,22.0,19.3,18.1,
19.3,19.7,25.1,26.1,24.4,23.3,22.1,23.1,21.7,22.4,20.4,17.8,
20.2,22.4,24.7,26.8,24.9,23.7,22.4,22.1,22.1,21.9,20.4,17.4,
16.8,21.5,24.9,26.0,23.8,23.1,22.5,22.0,22.0,22.2,19.4,18.5,
17.4,21.8,24.2,25.1,24.0,22.8,22.3,21.9,21.6,21.5,18.7,18.1,
17.5,21.8,23.9,26.4,24.9,23.0,22.2,22.5,21.5,21.4,19.4,19.7,
19.0,20.4,24.4,25.3,24.1,23.0,22.3,22.2,21.9,22.3,21.5,18.6,
20.3,21.4,26.4,26.1,25.2,23.3,21.8,22.2,21.8,22.0,20.8,18.3,
18.3,22.7,25.6,26.1,25.4,23.4,22.3,22.4,22.1,22.3,19.4,17.8,
20.0,22.4,24.6,26.9,26.6,23.7,23.0,22.8,22.9,22.4,20.2,20.2,
20.5,22.4,26.6,26.0,25.3,22.8,22.4,22.3,22.6,21.9,20.2,19.0,
17.7,20.5,23.7,26.5,25.1,22.8,22.5,22.5,22.1,21.6,19.4,19.3,
20.7,21.3,23.2,26.4,24.9,23.2,22.5,22.8,22.4,22.7,22.7,21.3,
20.6,23.7,26.3,25.8,24.5,23.9,22.6,22.7,22.5,22.1,19.7,18.7,
19.3,21.4,25.2,25.9,24.2,22.7,22.4,22.4,22.2,22.2,20.3,18.7,
18.1,21.9,25.0,26.9,25.6,23.3,22.3,22.6,22.6,22.4,22.9,19.6,
20.1,21.6,26.1,26.5,24.4,23.2,22.9,22.7,22.8,22.2,18.9,17.6,
17.8,20.5,25.4,26.4,24.8,24.2,22.9,22.4,22.7,22.5,20.0,19.8,
19.4,23.4,26.3,25.7,24.8,23.1,22.8,22.6,22.2,21.7,18.1,18.6,
19.9,20.9,24.6,25.0,24.8,22.9,22.5,22.5,22.8,23.2,20.7,19.4,
19.9,23.5,24.9,24.9,24.8,23.5,23.3,22.7,22.6,23.0,20.0,19.9,
20.1,21.9,26.5,25.8,24.8,23.9,22.9,22.9,22.0,22.1,20.2,18.3,
21.4,19.6,23.9,26.6,24.8,22.3,22.8,22.4,22.1,22.3,20.0,18.1,
18.7,20.6,25.3,27.1,24.8,23.8,22.8,22.0,21.8,21.8,19.5,20.0,
18.5,21.2,24.6,25.6,24.8,23.0,22.1,22.6,23.1,22.6,20.6,18.8,
20.2,24.3,25.1,25.9,24.8,23.5,23.1,23.1,22.8,23.4,21.3,19.1,
20.5,24.5,25.2,25.7,24.8,22.9,22.7,22.9,22.2,23.0,22.3,20.6,
19.6,25.2,27.7,27.6,24.8,23.9,23.2,23.0,22.7,22.5,20.8,20.2,
21.9,22.8,26.9,27.7,24.8,23.8,23.6,23.1,22.2,23.2,19.6,19.4,
19.2,22.5,25.7,26.3,24.8,23.7,23.1,22.6,22.4,23.2,22.6,20.2,
18.0,21.2,25.4,26.2,24.8,23.3,22.9,22.6,22.7,22.7,19.6,21.0,
19.5,24.3,27,25.8,24.8,23.9,22.8,23.2,22.9,23.2,21.4,20.2,
19.9,24.4,27.4,24.9,24.8,24.6,23.6,23.1,23.2,23.1,21.4,18.1,
19.2,24.4,26.7,25.8,24.8,24.1,23.1,22.9,22.8,22.9,20.3,18.9,
19.0,23.2,26.4,25.8,24.8,23.1,22.7,22.2,23.1,22.8,22.2,20.8,
19.6,21.9,27.2,25.3,24.8,23.2,23.0,23.0,22.6,22.9,22.2,19.4,
20.9,23.0,26.3,26.2,24.8,23.8,23.9,23.0,22.3,23.2,22.6,19.5,
19.3,23.4,25.6,26.2,24.8,24.9,23.8,23.4,24.6,23.1,21.3,18.6
}];

months=Table[n,{n,0,659}];
datamax=Table[{months[[u]],maxtemp[[u]]},{u,660}];
datamin=Table[{months[[u]],mintemp[[u]]},{u,660}];

Preliminary review

The Mango Temperature by Allison Zembrodt and Austin Hardesty was a a decent report and properly represented the minimum yearly data provided to them by the Togo’s Direction Generale de la Meteorologie Nationale. It is a misrepresentation of the maximum temperature taken in Mango, Togo between 1961 and 2015. When examining the report by the group that had previously had our city during the evaluation phase I noticed data points that failed to match the averages generated from the monthly data. Taking the initiative to go further I found the maximum temperature data that the Mango group had supposedly used. After comparing the means of the Mango yearly averages and other cities data in tandem with comparing individual data points such as their outlier of ~29 at the year 1995. This outlier does not exist within the Mango maximum yearly averages along with the means not matching between the report and my calculations of using their supposed data. Following comparison with through the yearly averages data of other cities and the “Mango maximum Temperatures Scatterplot” the data used by the group was most likely the maximum temperature data of Dapaong, a cities approximately 63 kilometers to the Northwest of Mango . It is the opinion of the group that the minimum yearly average temperatures is useful for our report, but the maximum yearly averages temperatures of Mango from the first group should not be used in further reports in this condition.

Background information on Mango, Togo

pr=ListPlot[datarain,Frame-> True,PlotLabel->"Mango Average Monthly Rain Data",FrameLabel->{"Numerical value of Month","Monthly Average Rainfall (In centimeters)"}]
pt=ListPlot[datarain2,Frame-> True,PlotLabel->"Mango Average Monthly Temperature",FrameLabel->{"Numerical value of Month","Average Temperature of Month"}]

Mango, Togo lies along the Oti River. The area is a valley that exist as a savannah. There is a dry season that runs from April(4) and November(11).  Having compared the two graphs above we see first the average monthly rainfall for Mango in centimeters (cm). The second graph takes place on the same x-axis and is the average monthly temperature in Mango. During the dry season from 4 through 11 we can notice that the rainfall decreases and the temperature rises reaching a maximum temperature the same month as the rainfall data’s minimum occurs. This is something we can watch out for in our data. This suggest that we should expect some sort of oscillation in our data through the year.

Verifying Yearly Means

We compared the yearly means calculated from the monthly data we have now and the yearly data provide during the first phase of the project. We found no differences between these values. This is before any outliers are ruthlessly identified and dealt with as that is the next step. As mentioned in the discussion of the preliminary work, the maximum yearly averages used by the prior group is believed to be incorrect for Mango so their mean will not match up with those of the Mango yearly maximum averages.

We are going to define significant change as a half degree or more increase or decrease. The same amount of change in temperature that NASA views as a significant change in regards to climate. Our maximum and minimum models suggest an increase of greater that half a degree. Below we see the maximum models fit for January, 1961, qm[0], and a prediction for January, 2016,qm[661], with the difference greater than a half degree. Below we see the minimum models fit for January, 1961, qmin[0], and a prediction for January, 2016,qmin[661], with the difference greater than a half degree and greater than that of the maximum. The average minimum temperatures seem to increase at a faster rate that the maximum averages.

qm[0]
qm[661]

qmin[1]
qmin[661]

Minimum
Ruthless attack on the minimum outliers

Decided to replace the suspected outliers with the averages of the months that came before and after the outlier month.
Suspected outliers, replacement data, and explanation provided below.
1978 May @ 29.5: 24.9 and 22.9, Result 23.9; This was a a 4.6 degree Celsius increase followed by a 5.6 degree drop between month when temperatures would typically be rising during the beginning of the dry season. 
1979 June @ 28.6: 24.4 and 22.1, Result 23.3;  4.2 degree spike with a 6.5 degree drop when temperature would typically be rising between June and July.
1980 June @ 28: 24.9 and 22.4, Result 23.7; A 3.1 degree rise but then a 5.6 degree drop when temperature would typically be rising between June and July.
1998 April @ 28.5: 24.9 and 24.8, Result 24.9, respectively. 3.6 degree rise followed by the 3.7 degree decrease right as the dry season beginning.

ListPlot[datamin,Frame->True,PlotLabel->"Mango Monthly Minimum Temperature Averages",FrameLabel->{"Months since January 1961","Monthly Minimum Average Temperature"}]

qmin= LinearModelFit[datamin,{x,x^2,Sin[(1/6)* π* x],Cos[(1/6) *π* x]},x,ConfidenceLevel->0.95]
qmin["ParameterConfidenceIntervals"]
qmin["ParameterTable"]
qmin["RSquared"]
ListPlot[qmin["FitResiduals"], Filling->Axis,PlotLabel->"Residuals Plot for Monthly Mango Data",Axes->True,AxesLabel->{"\!\(\*
StyleBox[\"Month\",\nFontWeight->\"Plain\"]\)","Temp"}]

p1=ListPlot[datamin];
p2=Plot[qmin[x],{x,0,659}];
Show[p1,p2,Frame->True,PlotLabel->"Report 2 Minimum graph",FrameLabel->{"Months since January 1961","Monthly Minimum Average temperature"}]

On the best model for the Mango Minimum Data, we could only achieve around .6046 for an R-Square as our highest. The period for the Sine and Cosine terms were determined by taking the period of two when modeling the yearly averages and dividing it by twelve as the months divide the year. All the terms in the parameter confidence intervals did not include zero and possessed small P-values. These models have a lot of data points to try and recreate so the smaller that optimal R-Square was expected. The residuals graph does not appear to have any patterns in it, but just have many points that are not explained very well by the model.

Maximum
Ruthless attack on the maximum outlier

Decided to replace the suspected outliers with the averages of the months that came before and after the outlier month.Suspected outliers and replacement values below.
1981, April @ 51.9: 38.4 and 33.9, Result 36.15; Rounded to 36.2 to match the other data. 51.9 degree Celsius was greater than two standard deviations outside of the sample standard deviations of the sample of 1981’s maximum data.

ListPlot[datamax,Frame->True,PlotLabel->"Mango Monthly Maximum Temperature Averages",FrameLabel->{"Months since January 1961","Monthly Maximum Average Temperature"}]

qm= LinearModelFit[datamax,{x,Sin[(1/6)* π* x],Cos[(1/6) *π* x]},x,ConfidenceLevel->0.95]
qm["ParameterConfidenceIntervals"]
qm["ParameterTable"]
qm["RSquared"]
ListPlot[qm["FitResiduals"], Filling->Axis,PlotLabel->"Residuals Plot for Monthly Mango Data",Axes->True,AxesLabel->{"\!\(\*
StyleBox[\"Month\",\nFontWeight->\"Plain\"]\)","Temp"}]
p1=ListPlot[datamax];
p2=Plot[qm[x],{x,0,659}];
Show[p1,p2,Frame->True,PlotLabel->"Report 2 Maximum graph",FrameLabel->{"Months since January 1961","Monthly Average temperature"}]

On the best model for the Mango maximum data, we could only achieve around .7464 for an R-Square as our highest. The period for the Sine and Cosine terms were again determined by taking the period of two when modeling the yearly averages and dividing it by twelve as the months divide the year. All the terms when checking the parameter confidence intervals did not include zero and had very small P-values. These models have a lot of data points to try and recreate so the smaller that optimal R-Square was expected. The residuals graph and R-Squared seem to suggest that the maximum model was better at capturing the data than the minimum’s model was.

Moving forward from this part of the project we will hopefully be able to get finer monthly rain averages from the Togolese and further examine the relationship between the average precipitation and the temperature. This would help us see how the local climate effects the temperature compared to CO2 from the Keeling data for the global climate. We could also ask for the weekly or daily temperature data that was used to average for the monthly data. The finer data along with the daily Keeling data that Dr. Long receives could display some interesting relationships. Our data had five outliers that we identified which we believe is acceptable considering there were over 1320 data point for the Togolese meteorologists to enter. We would like to know from the Togolese meteorologists though is related to the rainfall data and the relationship it has with the temperature data. Have you noticed the dry seasons getting longer or more severe over the course of the data collection? When the temperature was higher was there also drier months with it?